package d3_charset;

import java.io.*;

public class t7 {
    public static void main(String[] args) {
        try (Reader fr = new FileReader("src\\111");//创建字符输入流
        ) {
            //2.读取文本
//            int c;//记住字符编号
//            while ((c = fr.read()) != -1) {
//                System.out.print((char) c);
//            }

            //3.桶子方法buffer
            char[] buf = new char[3];
            int len ;//记住读多少字符
            while ((len = fr.read(buf)) != -1) {
                System.out.print(new String(buf, 0, len));
            }
        } catch (Exception e) {
            throw new RuntimeException(e);

        }
    }
}
